<?php

namespace app\api\controller;

use app\common\controller\Api;
use think\Exception;
use think\Request;
use think\Db;

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页
     *
     */
    public function index()
    {
        $this->success('请求成功');
    }

    public function message(){
      if (Request::instance()->isAjax()){
          $name = input("name");
          $company = input("company");
          $tel = input("tel");
          $email = input("email");
          $message = input("message");
          $data =['realname'=>"$name",'company'=>"$company",'tel'=>"$tel",'email'=>"$email",'content'=>"$message"];
          Db::name('wwh_message')->insert($data);
          return json(10000);
      }
    }
}
